package com.hnas.sys.orm;
// default package

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;


/**
 * UserAuthority entity. @author MyEclipse Persistence Tools
 */
//@Entity
//@Table(name="sys_user_authority"
// 
//)

public class UserAuthority  implements java.io.Serializable {


    // Fields    

     /**
	 * 
	 */
	private static final long serialVersionUID = -694957882193839672L;
    @Id @GeneratedValue(strategy=IDENTITY)    
    @Column(name="id", nullable=false)
	private long id;
	@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="user_id")
     private User user;
     @ManyToOne(fetch=FetchType.LAZY)
     @JoinColumn(name="authority_ID")
     private Authority authority;


    // Constructors

    /** default constructor */
    public UserAuthority() {
    }

    
    /** full constructor */
    public UserAuthority(User user, Authority authority) {
        this.user = user;
        this.authority = authority;
    }

   
    // Property accessors
//    @Id @GeneratedValue(strategy=IDENTITY)
//    
//    @Column(name="id", unique=true, nullable=false)

    public long getId() {
        return this.id;
    }
    
    public void setId(long id) {
        this.id = id;
    }
	

    public User getUser() {
        return this.user;
    }
    
    public void setUser(User user) {
        this.user = user;
    }
	

    public Authority getAuthority() {
        return this.authority;
    }
    
    public void setAuthority(Authority authority) {
        this.authority = authority;
    }
   








}